﻿@using Library
@model IQueryable<Ecommerce.Models.ApplicationUser>
@{
    ViewBag.Title = NOWCulture.GetString("Users");
    ViewBag.ActiveUrl = "admin/users";
    Layout = "_Layout.cshtml";
}

<h2>@NOWCulture.GetString("User list")</h2>
<button type="button" class="btn btn-success" data-editor="create" data-id=""><span class="glyphicon glyphicon-plus"></span>@NOWCulture.GetString("Create new")</button>
<div class="table-responsive">
    <table class="table table-hover" id="userlist">
        <thead>
            <tr>
                <th>@NOWCulture.GetString("Email")</th>
                <th>@NOWCulture.GetString("Full name")</th>
                <th>@NOWCulture.GetString("Phone")</th>
                <th>@NOWCulture.GetString("Gender")</th>
                <th>@NOWCulture.GetString("Birthday")</th>
                <th>@NOWCulture.GetString("Positon in organization")</th>
                <th>&nbsp;</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var user in Model)
            {
                @Html.Partial("_UserRow", user)
            }
        </tbody>
    </table>
</div>
<div class="modal fade" id="editorModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="@NOWCulture.GetString("Close")"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="modalLabel">@NOWCulture.GetString("Create new")/@NOWCulture.GetString("Edit") @NOWCulture.GetString("user")</h4>
            </div>
            <div id="formctnr"></div>
        </div>
    </div>
</div>
@Html.Action("ConfirmDialog", "Shared", new
{
    title = NOWCulture.GetString("Remove") + " " + NOWCulture.GetString("user"),
    content = string.Format(NOWCulture.GetString("Are you sure you want to remove this {0}?"), NOWCulture.GetString("user")),
    alertTitle = NOWCulture.GetString("Oh snap! You got an error!")
})
@section scripts
{
    @(HttpContext.Current.IsDebuggingEnabled ? Scripts.Render("~/bundles/admin-users") : Scripts.RenderFormat(@"<script src=""{0}"" async defer></script>", "~/bundles/admin-users"))
}